import { MessageApiInjection } from "naive-ui/lib/message/src/MessageProvider";
import { Router } from "vue-router";

let globalMessage: MessageApiInjection;
export const initGlobalMessage = (message: MessageApiInjection) => globalMessage = message;
export const useGlobalMessage = () => globalMessage;

let globalRouter: Router;
export const initGlobalRouter = (router: Router) => globalRouter = router;
export const useGlobalRouter = () => globalRouter;
export const $pushRoute = (to: any) => globalRouter.push(to);